<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <span class="one">英语</span> <span class="two">数学</span>
    <span class="one">语文</span> <span class="two">物理</span>
    <script>
      var Ospan1 = document.getElementsByClassName('one');
      var Ospan2 = document.getElementsByClassName('two');
      Ospan1[0].style.fontWeight = 'bold';
      Ospan2[1].style.background = 'red';
    </script>
  </body>
</html>